<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>LETUS</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="amazeui/assets/css/amazeui.min.css"/>
    <style>
        * { margin: 0; padding: 0; }
        html, body { height: 100%; width: 100%; }
    </style>
    <script>

    </script>
</head>
<body>
<h1>设置设备Wifi</h1>
<br><br>
<div id="message"></div>
</body>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">

    wx.config({
        beta : true, // 开启内测接口调用，注入wx.invoke方法
        debug : true, // 开启调试模式
        appId : '${config.appId}', // 第三方app唯一标识
        timestamp : '${config.timestamp}', // 生成签名的时间戳
        nonceStr : '${config.nonce}', // 生成签名的随机串
        signature : '${config.signature}',// 签名
        // jsApiList : ['configWXDeviceWiFi'] // 需要使用的jsapi列表
        jsApiList : ["scanQRCode"] // 需要使用的jsapi列表
    });

    var second = 5;
    wx.ready(function () {
        wx.scanQRCode({
            needResult: 1,
            desc: 'scanQRCode desc',
            success: function (res) {
                //扫码后获取结果参数:htpp://xxx.com/c/?6123，截取到url中的防伪码后，赋值给Input
                var url = res.resultStr;
                var tempArray = url.split('?');
                var tempNum = tempArray[1];
                $("#id_securityCode_input").val(tempNum);

            }
        });
    });
</script>
</html>